package com.prs.crm.domain.hr;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.prs.crm.domain.FlowCodeEntity;
import com.prs.crm.domain.cdxh.salary.DefineSalary;

@Entity
@Table(name = "hr_salary")
public class Salary extends FlowCodeEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	private String salarycode;
	private String name;
	@Column(length = 500)
	private String remark;
	private String state;
	private Date creattime;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "salary")
	private Set<SalaryRelat> relats;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "salary")
	private Set<Person> persons;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "salCriterion")
	private Set<DefineSalary> defineSalary;

	//
	// @OneToOne(fetch=FetchType.LAZY,mappedBy="person")
	// private Code code;
	public Set<Person> getPersons() {
		return persons;
	}

	public void setPersons(Set<Person> persons) {
		this.persons = persons;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getSalarycode() {
		return salarycode;
	}

	public void setSalarycode(String salarycode) {
		this.salarycode = salarycode;
	}

	// public Code getCode() {
	// return code;
	// }
	//
	// public void setCode(Code code) {
	// this.code = code;
	// }

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public void setRelats(Set<SalaryRelat> relats) {
		this.relats = relats;
	}

	public Set<SalaryRelat> getRelats() {
		return relats;
	}

	public void setCreattime(Date creattime) {
		this.creattime = creattime;
	}

	public Date getCreattime() {
		return creattime;
	}

	public Set<DefineSalary> getDefineSalary() {
		return defineSalary;
	}

	public void setDefineSalary(Set<DefineSalary> defineSalary) {
		this.defineSalary = defineSalary;
	}

}
